{% extends 'user/user.html' %}
{% load static %}
{% block title %}{{user.username}}的购物车{% endblock title %}
{% block page_title %}购物车{% endblock page_title %}
{% block haed_files %}
    <link rel="stylesheet" href="{% static 'css/cart.css' %}">
    <link rel="stylesheet" href="{% static 'css/blue.css' %}">
    <link rel="stylesheet" href="{% static 'css/button_style.css' %}">
    <link rel="stylesheet" href="{% static 'css/modal_alert.css' %}">
    <script src="{% static 'js/icheck.js' %}"></script>
    <script src="{% static 'js/modal_alert.min.js' %}"></script>
{% endblock haed_files %}
{% block index_block %}
    <div class="total_product_count">
        全部商品 <strong>{{total_count}}</strong> 件
    </div>
    <form action="/order/" method="post">
    <div class="cart">
        <div class="titles">
            <div>商品名称</div>
            <div>商品单位</div>
            <div>商品价格</div>
            <div>数量</div>
            <div>小计</div>
            <div>操作</div>
        </div>
        <ul>
            {% csrf_token %}
            {% for goods in goods_list %}
            <li>
                <div class="name">
                    <input type="checkbox" name="sku_id" value="{{goods.id}}" class="one">
                    <a href="{% url 'goods:detail' goods.id %}"><img src="{{goods.image.url}}" alt=""></a>
                    <div class="info">
                        <div><a href="{% url 'goods:detail' goods.id %}">{{goods.name}}</a></div>
                        <div>{{goods.price}}元/{{goods.unite}}</div> 
                    </div>
                </div>
                <div class="unit">{{goods.unite}}</div>
                <div class="price"><span>{{goods.price}}</span>元</div>
                <div class="count">
                    <button type="button"><span>-</span></button>
                    <input class="{{goods.sku_stock}}" type="text" value="{{goods.sku_count}}">
                    <button type="button"><span>+</span></button>
                </div>
                <div class="small_total"><span>{{goods.small_total}}</span>元</div>
                <div class="delete"><a class="{{goods.id}}" href="javascript:;">删除</a></div>
            </li>
            {% endfor %}
        </ul>
        <div class="calculate">
            <div>
                <label for="all">
                    <input id="all" type="checkbox">全选
                </label>
            </div>
            <div>
                <div>合计(不含运费)：<span>¥</span><strong>461.12</strong></div>
                <div>共计<span>29</span>件商品</div>
            </div>
            <input type="submit" value="去结算">
        </div>
    </div>
    </form>
{% endblock index_block %}
{% block bottom_file %}
<script src="{% static 'js/cart.js' %}"></script>
{% endblock bottom_file %}